﻿@model KRM.Core.Voucher
@{
    ViewBag.Title = "Voucher Management";
}
<div id="VoucherDetail-MessageResult"></div>
<div id="body-frVoucherDetail">
    @if(@Model !=null)
    {<div class="row-fluid">
        <div class="span6">
            <div class="control-group">
                <input type="hidden" name="VoucherID" value="@Model.VoucherID"/>
                <label for="textfield" class="control-label">Voucher Code</label>
                <div class="controls">
                    <input type="hidden" name="VoucherCode" value="@Model.VoucherCode"/>
                    <h4 style="color: #0C31C4;">@Model.VoucherCode</h4>
                </div>
            </div>
            <div class="control-group">
                <label for="textfield" class="control-label">Reason</label>
                <div class="controls">
                    @Html.DropDownList("VoucherReasonID", null, new {required = "required",style="width: 100%"})  
                </div>
            </div>

            <div class="control-group">
                <label for="textfield" class="control-label">ValueType</label>
                <div class="controls">
                    @Html.DropDownList("VoucherValueTypeID", null, new {required = "required",style="width: 100%"})  
                </div>
            </div>
            <div class="control-group">
                                
                <label for="textfield" class="control-label">Value</label>
                <div class="controls">
                    <input type="text"  name="Value"  id="Value" required="required" data-rule-number="true"class="input-block-level" value="@Model.Value">   

                </div>
            </div>

            <div class="control-group">
                <label for="textfield" class="control-label">Minimum Spend</label>
                <div class="controls">
                    <input type="text"  name="MinimumSpendValue"  id="MinimumSpendValue" required="required" data-rule-number="true"class="input-block-level" value="@Model.MinimumSpendValue">                                </div>
            </div>

            <div class="control-group">
                <label for="textfield" class="control-label">Voucher Type</label>
                <div class="controls">
                    @Html.DropDownList("VoucherTypeID", null, new {required = "required",style="width: 100%"})                            
                </div>
            </div>

            <div class="control-group">
                <label for="textfield" class="control-label">Expiry Date</label>
                <div class="controls">
                    <div id="datetimepicker2" class="input-append" style="width: 86%">
                        <input data-format="MM/dd/yyyy" type="text" class="input-block-level" name="ExpiryDate" id="ExpiryDate" value="@Model.ExpiryDate.ToString("MM/dd/yyyy")" required="required">
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                        </span>
                    </div>
                </div>  
            </div>
            <div class="control-group">
                <label for="textfield" class="control-label">Valid From Date</label>
                <div class="controls">
                    <div id="datetimepicker3" class="input-append"style="width: 86%">
                    <input data-format="MM/dd/yyyy" type="text" class="input-block-level"name="ValidFromDate" id="ValidFromDate" value="@Model.ValidFromDate.ToString("MM/dd/yyyy")" required="required">
                        <span class="add-on">
                            <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                        </span>
                    </div>
                </div>
            </div>

            <div class="control-group">
                <label for="textfield" class="control-label">Redemption Method</label>
                <div class="controls">
                    @Html.DropDownList("RedemptionMethodID", null, new {required = "required",style="width: 100%"})
                </div>
            </div>
            <div class="control-group">
                <label for="textfield" class="control-label">Groupon Order Value</label>
                <div class="controls">
                    <input type="text" id="GrouponOrderValue" name="GrouponOrderValue"  class="input-block-level"value="@Model.GrouponOrderValue">
                </div>
            </div>

            <div class="control-group">
                <div class="controls">
                    <label class="checkbox">
                        <input type="checkbox" name="IsUseForOnce" @(Model.IsUseForOnce == true ? "checked=checked" :"") value="true"> 
                        Use for once
                    </label>
                </div>
            </div>
        </div> 
         <div class="span6">
             <div class="control-group">
                 <label for="textfield" class="">Description</label>
                 <div class="">
                     <textarea name="VoucherDescription" id="VoucherDescription" class="input-block-level" rows="9" required = "required">@Model.VoucherDescription</textarea>
                 </div>
             </div>
                            
             <div class="control-group">
                 <label for="textfield" class="control-label">Campaign</label>
                 <div class="controls">
                     @Html.DropDownList("CampaignID", null, new {style="width: 100%"})
                 </div>
             </div>
             <div class="control-group">
                 <label for="textfield" class="control-label">Layout</label>
                 <div class="controls">
                     @Html.DropDownList("VoucherLayoutID", null, new {style="width: 100%"})
                 </div>
             </div>
             <div class="control-group">
                 <button type="button" class="btn btn-primary" onclick="PopupCenter('/voucher/ViewVoucherRestrictions/?voucherid=@Model.VoucherID',860, 550)">View Voucher Restrictions</button>
                 <button type="button" class="btn btn-primary" @(!ViewBag.HasOrder?"disabled=disabled" :"") onclick="PopupCenter('/voucher/VoucherOrders/?voucherid=@Model.VoucherID',860, 550)">View Orders</button>
             </div>
         </div>
         </div>
        <div class="row-fluid text-center">
            <button type="button" class="btn btn-success" onclick="PopupCenter('/voucher/AddVoucher/?reasonid=@Model.VoucherReasonID',860, 600)">New</button>
            <button type="submit" class="btn btn-primary" >Save</button>
            <button type="button" class="btn btn-danger" onclick="deletevoucher(@Model.VoucherID)">Delete</button>
            <button type="reset" class="btn ">Clear</button>
        </div>
    }
                
</div>



